package com.itheima.d4_create_thread;

import jdk.swing.interop.SwingInterOpUtils;

/**
 * 目标：掌握多线程创建方式二的匿名内部类写法。
 */
public class ThreadTest2_2 {
    public static void main(String[] args) {
        // 1、直接创建Runnable接口的匿名内部类形式（任务对象）
      /*  Runnable r = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 1000; i++) {
                    System.out.println("run" + i);
                }
            }
        };
        Runnable runnable = (() -> {
            for (int i = 0; i < 10; i++) {
                System.out.println();
            }
        });*/
        Thread thread = new Thread(()->{
            for (int i = 0; i < 100; i++) {
                System.out.println("你真帅"+i);
            }
        });
        thread.start();

        for (int i = 0; i < 100; i++) {
            System.out.println("丑的の"+i);
        }
    }}

